package com.smartticket.jeju.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.smartticket.jeju.service.PurchaseService;

@Controller
@RequestMapping("/userPurchase")
public class UserPurchase 
{
	@Autowired
	private PurchaseService purchaseService;
	
	@RequestMapping
	public String action(@RequestParam int count, @RequestParam int ticket_id)
	{
		// 세션 확인
		// 로그인 안한 유저라면 로그인 페이지로 이동
		String user_id = "dongdang";
		
		purchaseService.save(user_id, ticket_id, count);
		
		return "redirect:/main";
	}
}
